#include "EPhMaterial.h"
#include "eCPP.h"

namespace engine
{

//------------------------------------------------------------
EPhMaterialDesc::EPhMaterialDesc() :
m_fDynamicFriction( 0.5f ),
m_fStaticFriction( 0.5f ),
m_fRestitution( 0.5f )
{

}

//------------------------------------------------------------
bool EPhMaterialDesc::isValid() const
{
  cTEST( m_fDynamicFriction >= 0.f );
  cTEST( m_fStaticFriction >= 0.f );
  cTEST( m_fRestitution >= 0.f );
  return true;
}

//------------------------------------------------------------
const NxMaterialDesc EPhMaterialDesc::getNxMaterialDesc() const
{
  NxMaterialDesc nxDesc;
  nxDesc.flags              = 0;
  nxDesc.dynamicFriction    = m_fDynamicFriction;
  nxDesc.staticFriction     = m_fStaticFriction;
  nxDesc.restitution        = m_fRestitution;

  return nxDesc;
}

//------------------------------------------------------------
EPhMaterial::EPhMaterial(NxMaterial& nxMat ) :
m_NxMaterial( nxMat )
{

}

//------------------------------------------------------------
int EPhMaterial::getMaterialIndex() const
{
  return m_NxMaterial.getMaterialIndex();
}
} // end namespace